<template>
	<view>
		<scroll-view scroll-x class="bg-white nav">
		<view class="header flex text-center">
			<button @tap="GetNewOrderNo(false)">创建新单</button>
			<button @tap="sureClear">清空单据</button>
			<button @tap="lookOrder()">查询单据</button>
			<button @tap="isChangeOrder()" v-if="!isChange">提交单据</button>
			<button @tap="isChangeOrder()" v-if="isChange">修改单据</button>
		</view>
			<view class="main">
				<view class="main-box">
					<form>
						<view v-if="TabCur ==0" class="cg-main">
							<view  class="tabHeader" :class="isLookHeaderMore?'tabHeaderMore':''">
								<view class="cu-form-group">
									<view class="title">*单据编号:</view>
									<input class="inpt" disabled="true" name="input" :value="BillNo" placeholder="点击获取单号" @tap="GetNewOrderNo(false)"></input>
									
								</view>
								<view class="cu-form-group">
									<view class="title">*单据日期:</view>
									<picker mode="date" :value="BillDate" @change="DateChange">
										<view class="picker">
											{{BillDate}}
										</view>
									</picker>
								</view>
								<view class="cu-form-group">
									<view class="title">*盘点批次:</view>
									<input class="inpt" disabled="true" name="input" :value="SelectBatchObj.Inventorybatch" placeholder="批号"></input>
									<button class="cu-btn round stop text-white"  @tap="GetInventoryMessage()">查询</button>
								</view>
								 <!-- data-target="StoreModal" @tap="showModal" -->
								<view class="cu-form-group">
									<view class="title">*仓&emsp;&nbsp;&nbsp;库&nbsp;:</view>
									<view class="inpt1"><input type="text" placeholder="不可选择" :value="SelectBatchObj.StoreName" disabled="true"
										 style="text-align: left;" />
										<view class="cu-modal" :class="modalName=='StoreModal'?'show':''">
											<view class="cu-dialog">
												<view class="cu-bar bg-white justify-end">
													<view class="content">请选择仓库</view>
													<view class="action" @tap="hideModal">
														<text class="cuIcon-close text-red"></text>
													</view>
												</view>
												<view class="padding-xl">
													<view class="searchStore">
														<input placeholder="请输入仓库名称" v-model="SearchStoreName" @input="filterStore"/>
														<button @tap="searchStore">搜索</button>
													</view>
													<view class="StoreListWrap">
														<view v-for="(item,index) in TempStoreList" :key="item.StoreID" @tap="selectStore(index)">{{item.StoreName}}</view>
													</view>
												</view>
											</view>
										</view>
									</view>
								</view>
								<view class="cu-form-group">
									<view class="title">*业&nbsp;务&nbsp;员&nbsp;:</view>
									<view class="inpt1"><input type="text" placeholder="点击获取" :value="SelectOptionsObj.OperatorName" disabled="true"
										 style="text-align: left;" data-target="OptionsModal" @tap="showModal" />
										<view class="cu-modal" :class="modalName=='OptionsModal'?'show':''">
											<view class="cu-dialog">
												<view class="cu-bar bg-white justify-end">
													<view class="content">请选择业务员</view>
													<view class="action" @tap="hideModal">
														<text class="cuIcon-close text-red"></text>
													</view>
												</view>
												<view class="padding-xl">
													<view class="searchStore">
														<input placeholder="请输入业务员名称" v-model="SearchOptionName" @input="filterOption"/>
														<button @tap="searchOption">搜索</button>
													</view>
													<view class="StoreListWrap">
														<view v-for="(item,index) in TempOptionList" :key="item.OperatorID" @tap="selectOptions(index)">{{item.OperatorName}}</view>
													</view>
												</view>
											</view>
										</view>
									</view>
								</view>	
								
								<view class="cu-form-group">
									<view class="title">制&nbsp;单&nbsp;人&nbsp;&nbsp;:</view>
									<input class="inpt" disabled="true" name="input" :value="CreateName" ></input>
								</view>
								<view class="cu-form-group">
									<view class="title">备&emsp;&nbsp;&nbsp;注&nbsp;:</view>
									<input class="inpt" name="input" placeholder="点击修改" v-model="Remark"></input>
								</view>
								<view class="cu-form-group lookHeaderMore">
									<view class="title" style="width: 100%;text-align: center;" @tap="lookHeaderMore()">{{TbHeaderMore}}</view>
								</view>
							</view>
							<view>
								<view class="searchInput" v-if='BillType!=18'>
									<view class="goodFilter">
										<uniIcon type="search" size="14" style="line-height: 28px;margin-left: 5px;margin-right: 5px;color: #a7aab3;" /><input
										 placeholder="输入条码进行搜索" class="searchOption" confirm-type="search" type="text" @confirm="search()" v-model="searchKey"></input>
									</view>
									<view class="searchOptions">
										<button class="giveSong" @tap="gogoodlist()"></button>
										<button class="getPicture" @tap="tel()"></button>
									</view>
								</view>
								<view class="cu-modal" :class="modalName=='StoreScanGoodModal'?'show':''">
									<view class="cu-dialog">
										<view class="cu-bar bg-white justify-end">
											<view class="content">请选择商品</view>
											<view class="action" @tap="hideModal">
												<text class="cuIcon-close text-red"></text>
											</view>
										</view>
										<view class="padding-xl">
											<view class="GoodsListWrap">
												<view v-for="(item,index) in scanGoodList" :key="item.GoodsCode" @tap="selectGoodsList(index)">
												<image :src="unLoadimg" v-if="item.Goods_Image_Path1==''||item.Goods_Image_Path1=='underfind'" mode="aspectFill"></image>
												<image :src="item.Goods_Image_Path1" mode="aspectFill" v-else></image>
												<text>{{item.GoodsName}}</text>
												</view>
											</view>
										</view>
									</view>
								</view>
							</view>
							<view class="nowGoodCount"><view>商品数:{{OrderGoodsListLength}}</view>
							<view>商品总金额:<text class="red">{{goodAllAmount}}</text></view></view>
							<!--商品明细列表-->
							<addOrderList :OrderGoodsList='OrderGoodsList' @deleteSelectGood='deleteSelectGood' @changeInfo='changeInfo' v-if="!isChangeShow"></addOrderList>
							<selectSimple :OrderGoodsList="OrderGoodsList" @deleteSelectGood="deleteSelectGood" @changeInfo="changeInfo"  v-else></selectSimple>
						</view>
					</form>
				</view>
			</view>
		</scroll-view>
			<view class="quiteTop" v-if="isShowTip" @tap="scrollTop">返回</br>顶部</view>
		<view class="cu-modal" :class="isShowScanModel?'show':''">
			<view class="cu-dialog ls-main">
				<view class="cu-bar bg-ls justify-between">
					<view class="action">
						<view class="cuIcon-info text-white" v-show="false"></view>
					</view>
					<view class="content text-white">选择批号</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-white"></text>
					</view>
				</view>
				<view class="padding text-left bg-white ls-contain">
					<scroll-view scroll-y style="height: 400px;padding-bottom: 100px">
						<view class="ls-box" @tap="choosesGoods(index)" v-for="(item,index) in storeList" :key='index' :data-index="index">
							<!-- <view class="text-black">数据库：</view> -->
							<view>批次号:{{item.Inventorybatch}}</view>
						</view>
					</scroll-view>
				</view>
			</view>
		</view>
		<uni-calendar ref="calendar" :insert="false" @confirm="confirm" />
		<uni-calendar ref="calendar1" :insert="false" @confirm="confirm1" />
		<uni-calendar ref="calendar2" :insert="false" @confirm="confirm2" />
		<settingOption :settingObj="'setting'+BillType" :modalName="modalName"
		 @changeSetting="changeSetting" @ycDy="ycDy" @djSh="djSh" @PrintOrder="PrintOrder" @hideModal="hideModal" :modalNames="modalNames" @radioChange="radioChange"
		ref="settingOption" @changeSelectShow="changeSelectShow" @xpDy="xpDy"></settingOption>
	</view>
</template>
<script src="./js/add-order-Inventory.js">

</script>

<style scoped>
	@import url("../index/index.css");
	@import url("./css/add-order-Inventory.css");
</style>
